home *** CD-ROM | disk | FTP | other *** search
- property pSpr, pCenter, pRadius
-
- on beginSprite me
- pSpr = sprite(me.spriteNum)
- pCenter = sprite(me.spriteNum - 1).loc
- pRadius = 15
- end
-
- on mUpdate me, ounces
- repeat while ounces >= 12
- ounces = ounces - 12
- end repeat
- percent = ounces / 12.0
- theta = percent * 6.28319000000000027
- pSpr.member.shapeType = #line
- if percent <= 0.25 then
- direction = 1
- else
- if (percent > 0.25) and (percent <= 0.5) then
- direction = 0
- else
- if (percent > 0.5) and (percent <= 0.75) then
- direction = 1
- else
- if (percent > 0.75) and (percent <= 1.0) then
- direction = 0
- end if
- end if
- end if
- end if
- pSpr.member.lineDirection = direction
- newVertex = pCenter + point(integer(pRadius * sin(theta)), -integer(pRadius * cos(theta)))
- if abs(pCenter[1] - newVertex[1]) <= 1 then
- newVertex[1] = newVertex[1] + 3
- pSpr.member.shapeType = #rect
- else
- if abs(pCenter[2] - newVertex[2]) <= 1 then
- newVertex[2] = newVertex[2] + 3
- pSpr.member.shapeType = #rect
- end if
- end if
- pSpr.rect = rect(pCenter, newVertex)
- end
-
- on endSprite me
- pSpr.member.shapeType = #line
- end
-